$(function() {
	! function(e) {
		var n = e.toLowerCase().indexOf("chrome"),
			r = 0,
			i = e.toLowerCase().indexOf("android");
		if (-1 != n) {
			var s = e.indexOf(" ", n),
				o = e.substring(n + 7, s);
			r = Number(o.split(".")[0])
		} - 1 != i && $("._webPush").removeClass("dn")
	}(navigator.userAgent)
});
$(function() {
	$.fn._addAnm = function(e) {
		{
			var t = this,
				n = $.extend({}, {
					add: "anm",
					$tgt: $("._target"),
					trgDisp: !1
				}, e),
				s = function() {
					t.addClass("dn")
				};
			! function() {
				n.$tgt.addClass(n.add), n.trgDisp && s()
			}()
		}
		return this
	}, $.fn._submitForm = function(e) {
		return $(e).closest("form").submit(), this
	}, $.fn._slideShow = function(e) {
		{
			var t = this,
				n = $.extend({}, {
					elem: "li",
					chg_speed: 3e3,
					in_speed: 1500,
					out_speed: 1500,
					wrap_height: "250px"
				}, e),
				s = function() {
					var e = $(window).width() / 375;
					t.css("zoom", e)
				};
			! function() {
				s(), $(window).on("orientationchange resize", s);
				var e = t.children(n.elem),
					o = e.length - 1,
					r = 0;
				t.css({
					position: "relative",
					height: n.wrap_height
				}), e.css({
					position: "absolute",
					top: 0,
					left: 0,
					display: "none"
				}), $(e[r]).css("display", "block");
				setInterval(function() {
					$(e[r]).fadeOut(n.out_speed), r++, r > o && (r = 0), $(e[r]).fadeIn(n.in_speed)
				}, n.chg_speed)
			}()
		}
		return this
	};
	var e = {
		$header: $(".header"),
		$siteTypeNavigation: $(".siteTypeNavigation"),
		$keywordSearch_input: $("#contents .keywordSearch_input"),
		$keywordSearch_button: $("#contents .keywordSearch_button"),
		$upper_area: $(".upper_area"),
		$trend_ttl: $(".trend_ttl"),
		$_focusTrigger: $("._focusTrigger"),
		$_targetFocus: $("._targetFocus"),
		$_closeKeyWord: $("._closeKeyWord")
	};
	e.mainCtrler = function() {
		var t = function() {
			"none" == e.$_closeKeyWord.css("display") && (e.$_focusTrigger._addAnm({
				$tgt: $("._targetFocus")
			}), $("html, body").animate({
				scrollTop: 0
			}, 300), e.add())
		};
		e.$keywordSearch_button.on("click", function(n) {
			n.preventDefault(), "" != e.$keywordSearch_input.val() ? $(this)._submitForm(this) : t()
		}), e.$keywordSearch_input.on("focus", function(e) {
			e.preventDefault(), t()
		}), e.$_closeKeyWord.on("click", function(t) {
			t.preventDefault(), e.remove()
		})
	}, e.add = function() {
		e.$_closeKeyWord.addClass("db"), e.$trend_ttl.addClass("db"), e.$header.addClass("dn"), e.$siteTypeNavigation.addClass("dn"), e.$upper_area.addClass("dn")
	}, e.remove = function() {
		e.$_closeKeyWord.removeClass("db"), e.$trend_ttl.removeClass("db"), e.$header.removeClass("dn"), e.$siteTypeNavigation.removeClass("dn"), e.$upper_area.removeClass("dn"), e.$_targetFocus.removeClass("anm")
	};
	var t = function() {
		window.sessionStorage.length > 0 && $("._tabArea").each(function() {
			t.storageCtrl({
				$ele: $(this),
				name: "._tab"
			}), t.storageCtrl({
				$ele: $(this),
				name: "._contents"
			})
		}), $("._tabArea ._tab").on("click", function(e) {
			e.preventDefault();
			var n = $(this).closest("._tabArea").prop("id"),
				s = $(this).index();
			//sessionStorage.setItem(n + SITE_TYPE, s), t.forcingResize()
		})
	};
	t.storageCtrl = function(e) {
		e.$ele.find(e.name).each(function() {
			var e = $(this),
				t = sessionStorage.getItem($(this).closest("._tabArea").prop("id") + SITE_TYPE);
			t && (e.removeClass("_selected"), e.index() == t && e.addClass("_selected"))
		})
	}, t.forcingResize = function() {
		$(window).trigger("resize")
	}, $("._focusTrigger").length > 0 && e.mainCtrler(), window.sessionStorage && t(), $("._slideBnrList")._slideShow()
});
